package com.bwhx.eruler.dao.casdilly.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.bean.casdilly.Contract;
import com.bwhx.eruler.bean.casdilly.ContractStatus;
import com.bwhx.eruler.dao.casdilly.ContractDAO;
import com.bwhx.eruler.dao.impl.BaseDaoImpl;

@Repository
public class ContractDAOImpl extends BaseDaoImpl<Contract> implements ContractDAO {

	public ContractDAOImpl() {
		this.setNs("com.bwhx.eruler.mapper.casdilly.ContractMapper.");
	}

	@Override
	public Contract findBySerial(String getcPIDSerial) {
		
		return getSqlSession().selectOne(this.getNs() + "findBySerial", getcPIDSerial);
	}

	@Override
	public List<ContractStatus> listcontractStatus(Page p) {
 		return getSqlSession().selectList(this.getNs() + "listcontractStatus", p);
	}

	@Override
	public Integer countcontractStatus(Contract contract) {
		return getSqlSession().selectOne(this.getNs() + "countcontractStatus", contract);
	}

	@Override
	public void updateDelFlag(Contract contract) {
		getSqlSession().update(this.getNs() + "updateDelFlag", contract);
		
	}
	
	

	

	
	

	


/*	@Override
	public List<ClothesType> findByTypeCPIDSerial(String contractID) {
		List<ClothesType> selectList = getSqlSession().selectList(this.getNs() + "findByTypeCPIDSerial", contractID);
		
		for (ClothesType clothesType : selectList) {
			List<BodyItem> selectList2 = getSqlSession().selectList(this.getNs() + "getBodyItem", clothesType.getTypeItemsStr().split(","));
			clothesType.setTypeItems(selectList2);
		}
		
		return selectList;
	}*/
	
	

}
